package xyz.scootaloo.oj.offer

import org.junit.Test
import java.lang.StringBuilder

/**
 * @author flutterdash@qq.com
 * @since 2021/4/8 18:06
 */
class P05 {

    private fun replaceSpace(s: String): String {
        val cache = StringBuilder()
        for (c in s) {
            if (c == ' ')
                cache.append("%20")
            else
                cache.append(c)
        }
        return cache.toString()
    }

    @Test
    fun test0() {
        println(replaceSpace("We are happy."))
    }

}
